﻿namespace Word
{
    using System.Windows.Controls;
    using System.Windows.Navigation;
    using System.IO;
    using System.Windows;
    using Telerik.Windows.Controls;

    /// <summary>
    /// Home page for the application.
    /// </summary>
    public partial class Home : Page
    {
        /// <summary>
        /// Creates a new <see cref="Home"/> instance.
        /// </summary>
        public Home()
        {
            InitializeComponent();

            this.Title = ApplicationStrings.HomePageTitle;
        }

        /// <summary>
        /// Executes when the user navigates to this page.
        /// </summary>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void Statistics_Click(object sender, RoutedEventArgs e)
        {
            //string statistics = this.editor.Document.GetStatisticsInfo().ToString();
            //MessageBox.Show(statistics, "Document Statistics", MessageBoxButton.OK);
        }

        private void ViewDocumentStructure_Click(object sender, RoutedEventArgs e)
        {
            //RadWindow window = new RadWindow();

            //DocumentModelTreeViewer documentTreeViewer = new DocumentModelTreeViewer();
            //documentTreeViewer.DisplayDocumentLayoutTree(this.editor.Document);

            //window.Content = documentTreeViewer;
            //window.Owner = this;

            //window.WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterOwner;
            //window.Width = 600;
            //window.Height = 750;

            //window.Owner = this;
            //window.ShowDialog();
        }

        private void editor_Drop(object sender, DragEventArgs e)
        {
            //FileInfo[] droppedFiles = e.Data.GetData(DataFormats.FileDrop) as FileInfo[];

            //foreach (FileInfo droppedFile in droppedFiles)
            //{
            //    if (this.IsSupportedImageFormat(droppedFile.Extension))
            //    {
            //        using (Stream imageStream = droppedFile.OpenRead())
            //        {
            //            this.editor.InsertImage(imageStream, droppedFile.Extension);
            //        }
            //    }
            //}
        }

    }
}